package com.wmz.policyMode;

import com.wmz.policyMode.context.Context;
import com.wmz.policyMode.strategy.ConcreteStrategyA;
import com.wmz.policyMode.strategy.ConcreteStrategyB;

/**
 * @version 1.0
 * @Author： 李鹤春
 * @date： 2025/2/28 13:55
 * @description: 主启动类：策略模式普通版
 */
public class StrategyPattern {
    public static void main(String[] args) {
        Context context = new Context();
        String str = "B";
        if("A".equals(str)) {
            context.setStrategy(new ConcreteStrategyA());
        } else if("B".equals(str)) {
            context.setStrategy(new ConcreteStrategyB());
        }
        context.strategyMethod();
    }

}
